import { OptionTypes } from '@/utils/types.d';
import { PlateColorEnum } from '../Parking/Records/types.d';

export const enum AbnormalOrderTypeEnum {
  SENSOR_OCCUPY_PATROL_FREE = 1, // 地磁有车，巡检无车
  SENSOR_FREE_PATROL_OCCUPY = 2, // 地磁无车，巡检有车
  UNKNOWN_LICENSE = 3, // 未知车牌
  LICENSE_SIMILAR = 4, // 车牌变更异常
  LICENSE_CHANGED = 5, // 地磁未变，车牌变化
  LICENSE_CONFLICT = 6, // 车牌冲突
}

export const SENSOR_STATUS_MAP = new Map()
  .set(0, '车辆驶出')
  .set(1, '车辆驶入')
  .set(2, '持续空闲')
  .set(3, '持续占用');

export const AboTypeOptions: OptionTypes[] = [
  {
    value: AbnormalOrderTypeEnum.SENSOR_OCCUPY_PATROL_FREE,
    label: '地磁有车，巡检无车',
  },
  {
    value: AbnormalOrderTypeEnum.SENSOR_FREE_PATROL_OCCUPY,
    label: '地磁无车，巡检有车',
  },
  {
    value: AbnormalOrderTypeEnum.LICENSE_CHANGED,
    label: '地磁未变，车牌变化',
  },
  {
    value: AbnormalOrderTypeEnum.LICENSE_SIMILAR,
    label: '车牌变更异常',
  },
  {
    value: AbnormalOrderTypeEnum.UNKNOWN_LICENSE,
    label: '未知车牌',
  },
  {
    value: AbnormalOrderTypeEnum.LICENSE_CONFLICT,
    label: '车牌冲突',
  },
];
export const enum AbnormalOrderStatus {
  WAITING = 1, // 待处理
  HANDLED = 2, // 已处理
  CANCELED = 3, // 已作废
}

export const AboStatusOptions: OptionTypes[] = [
  {
    value: AbnormalOrderStatus.WAITING,
    label: '待处理',
  },
  {
    value: AbnormalOrderStatus.HANDLED,
    label: '已处理',
  },
  {
    value: AbnormalOrderStatus.CANCELED,
    label: '已作废',
  },
];

export const getAbnormalStatusPic = (status: AbnormalOrderStatus) => {
  switch (status) {
    case AbnormalOrderStatus.WAITING:
      return '/audit/unReviewed.png';
    case AbnormalOrderStatus.HANDLED:
      return '/audit/reviewed.png';
    default:
      return '/audit/review_canceled.png';
  }
};
export const ABO_TYPE_MAP = new Map()
  .set(AbnormalOrderTypeEnum.SENSOR_OCCUPY_PATROL_FREE, '地磁有车，巡检无车')
  .set(AbnormalOrderTypeEnum.SENSOR_FREE_PATROL_OCCUPY, '地磁无车，巡检有车')
  .set(AbnormalOrderTypeEnum.UNKNOWN_LICENSE, '未知车牌')
  .set(AbnormalOrderTypeEnum.LICENSE_SIMILAR, '车牌变更异常')
  .set(AbnormalOrderTypeEnum.LICENSE_CHANGED, '地磁未变，车牌变化')
  .set(AbnormalOrderTypeEnum.LICENSE_CONFLICT, '车牌冲突');

export const PlateColorOptions: OptionTypes[] = [
  { value: PlateColorEnum.unknown, label: '未知' },
  { value: PlateColorEnum.blue, label: '蓝色' },
  { value: PlateColorEnum.yellow, label: '黄色' },
  { value: PlateColorEnum.white, label: '白色' },
  { value: PlateColorEnum.black, label: '黑色' },
  { value: PlateColorEnum.green, label: '绿色' },
  { value: PlateColorEnum.greenYellow, label: '黄绿色' },
];

export const PLATE_COLOR_MAP = new Map()
  .set(PlateColorEnum.blue, '蓝色')
  .set(PlateColorEnum.yellow, '黄色')
  .set(PlateColorEnum.white, '白色')
  .set(PlateColorEnum.black, '黑色')
  .set(PlateColorEnum.green, '绿色')
  .set(PlateColorEnum.greenYellow, '黄绿色');

export const OCCUPY_TITLE_ARR = [
  '此泊位当前停车记录',
  '此泊位上条停车记录',
  '此泊位上上条停车记录',
];
export const FREE_TITLE_ARR = [
  '此泊位上条停车记录',
  '此泊位上上条停车记录',
  '此泊位上上上条停车记录',
];
